package com.atguigu.gulimall.tps.utils;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;


@Component
public class OssData {



    private static String accessKey;

    private static String secretKey;

    private static String endpoint;

    private static String bucket;


    @Value("${oss.access-key}")
    public void setAccessKey(String accessKey) {
        OssData.accessKey = accessKey;
    }

    @Value("${oss.secret-key}")
    public void setSecretKey(String secretKey) {
        OssData.secretKey = secretKey;
    }

    @Value("${oss.endpoint}")
    public void setEndpoint(String endpoint) {
        OssData.endpoint = endpoint;
    }

    @Value("${oss.bucket}")
    public void setBucket(String bucket) {
        OssData.bucket = bucket;
    }




    public static String getAccessKey(){
        return accessKey;
    }

    public static String getSecretKey(){
        return secretKey;
    }

    public static String getEndpoint(){
        return endpoint;
    }

    public static String getBucket(){
        return bucket;
    }


}
